//
//  QualityHeadView.m
//  YaoHeAPP
//
//  Created by mac on 16/1/29.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "QualityHeadView.h"
#import "Define.h"

@implementation QualityHeadView

//-(id)initWithReuseIdentifier:(NSString *)reuseIdentifier
//{
//    self=[super initWithReuseIdentifier:reuseIdentifier];
//    if (self) {
//        
//        //区头选择按钮
//        _quTouBtn=[UIButton buttonWithType:UIButtonTypeCustom];
//        _quTouBtn.selected=NO;
//        [_quTouBtn setBackgroundImage:[UIImage imageNamed:@"ic_radio_btn_normal"] forState:UIControlStateNormal];
//        
//        _quTouBtn.frame=CGRectMake(10, 5, 25, 25);
//        _quTouBtn.layer.masksToBounds=YES;
//        _quTouBtn.layer.cornerRadius=10;
//        [_quTouBtn addTarget:self action:@selector(quTouClick:) forControlEvents:UIControlEventTouchUpInside];
//        [self addSubview:_quTouBtn];
//        
//        //标签
//        _companyLabel=[[UILabel alloc]init];
//        _companyLabel.font=font16;
//         _companyLabel.textColor=[UIColor colorWithRed:31.f/255.f green:31.f/255.f blue:31.f/255.f alpha:1.f];
//        [self addSubview:_companyLabel];
//        
//        _companyLabel.frame=CGRectMake(40, 7.5, 200, 20);
////        [_companyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
////            make.left.offset(40);    make.top.offset(7.5);
////            make.height.offset(20);
////        }];
//        
//        
//        //分割线
//        UIView *vwimg=[[UIView alloc]init];
//        vwimg.backgroundColor=[UIColor colorWithRed:242.f/255.f green:242.f/255.f blue:242.f/255.f alpha:1];
//        vwimg.frame=CGRectMake(0, self.frame.size.height-1, self.frame.size.width, 1);
//        [self addSubview:vwimg];
//        
//        
//    }
//    return self;
//
//}

-(id)initWithFrame:(CGRect)frame
{
    self=[super initWithFrame:frame];
    if (self) {

        //区头选择按钮
        _quTouBtn=[UIButton buttonWithType:UIButtonTypeCustom];
//        _quTouBtn.selected=NO;
        [_quTouBtn setBackgroundImage:[UIImage imageNamed:@"ic_radio_btn_normal"] forState:UIControlStateNormal];
        
        _quTouBtn.frame=CGRectMake(10, 5, 20, 20);
        _quTouBtn.layer.masksToBounds=YES;
        _quTouBtn.layer.cornerRadius=10;
        //[_quTouBtn addTarget:self action:@selector(quTouClick:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_quTouBtn];
        
        //标签
        _companyLabel=[[UILabel alloc]init];
        _companyLabel.font=Font(13);
        _companyLabel.textColor=[UIColor colorWithRed:31.f/255.f green:31.f/255.f blue:31.f/255.f alpha:1.f];
        [self addSubview:_companyLabel];
        _companyLabel.frame=CGRectMake(35, 5, self.frame.size.width-35-10, 20);
//        [_companyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//            make.left.offset(40);    make.top.offset(7.5);
//            make.height.offset(20);
//        }];
        
        //分割线
        UIView *vwimg=[[UIView alloc]init];
        vwimg.backgroundColor=[UIColor colorWithRed:242.f/255.f green:242.f/255.f blue:242.f/255.f alpha:1];
        vwimg.frame=CGRectMake(0, self.frame.size.height-1, self.frame.size.width, 1);
        [self addSubview:vwimg];

        
    }
    return self;
}
//区头选择按钮
-(void)quTouClick:(UIButton *)btn
{
    btn.selected = !btn.selected;
    if ([self.delegate respondsToSelector:@selector(headerViewdelegate:AndBtn:)]) {
        [self.delegate headerViewdelegate:self AndBtn:btn];
    }
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
